package com.mzba.place.fragment;

import android.os.Bundle;
import android.text.SpannableString;
import android.text.Spanned;
import android.text.style.ForegroundColorSpan;
import android.text.style.RelativeSizeSpan;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.actionbarsherlock.app.SherlockFragment;
import com.mzba.place.R;
/**
 * 
 * @author 06peng
 *
 */
public class AboutFragment extends SherlockFragment {
private TextView agreement; 
	/* (non-Javadoc)
	 * @see android.support.v4.app.Fragment#onCreateView(android.view.LayoutInflater, android.view.ViewGroup, android.os.Bundle)
	 */
	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		View view = inflater.inflate(R.layout.fragment_about, null);
		intiView(view);
		return view;
	}
	
	private void intiView(View view){
		agreement = (TextView)view.findViewById(R.id.tv_agreement);
		String text = this.getString(R.string.agreement);

		SpannableString ss = new SpannableString(text);
		
		ss.setSpan(new ForegroundColorSpan(getActivity().getResources().getColor(R.color.setting_green)), 0, 12,
				Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
		ss.setSpan(new RelativeSizeSpan(0.8f), 12, text.length(),
				Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
		agreement.setText(ss);
	}

	
}
